//
//  YpywCellView.m
//  上海杨浦
//
//  Created by FrankChen on 13-5-17.
//  Copyright (c) 2013年 FrankChen. All rights reserved.
//

#import "YpywCellView.h"

@implementation YpywCellView
@synthesize title;
@synthesize time;


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
            
    if (self) {
        // Initialization code
        //[self setBackgroundColor:[UIColor grayColor]];
        //
        //[self setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bgImg_cell.png"]]];
    }
    return self;
}

-(void)inputData{
    [self AddTitleLabel];
    [self AddTimeLabel];
    [self AddSepareator];
}

- (void) AddTitleLabel{
    UILabel *label=[[[UILabel alloc]initWithFrame:CGRectMake(12, 10, 270, 18)]autorelease];
    UIFont *font=[UIFont fontWithName:@"FZHTJW--GB1-0" size:17.0f];
    [label setFont:font];
    [label setBackgroundColor:[UIColor clearColor]];
    
    [label setTextColor:[UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:1]];
    [label setText:title];
    [label setTextAlignment:NSTextAlignmentLeft];
    
    [self addSubview:label];
}

- (void) AddTimeLabel{
    UILabel *label=[[[UILabel alloc]initWithFrame:CGRectMake(0, 32, 280, 14)]autorelease];
    UIFont *font=[UIFont fontWithName:@"FZHTJW--GB1-0" size:13.0f];
    [label setFont:font];
    [label setBackgroundColor:[UIColor clearColor]];
    
    [label setTextColor:[UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:1]];
    [label setText:time];
    [label setTextAlignment:NSTextAlignmentRight];
    [self addSubview:label];
}

-(void) AddSepareator{
    UIImageView *imageView=[[[UIImageView alloc]initWithFrame:CGRectMake(12, 49, 266, 1)]autorelease];
    [imageView setImage:[UIImage imageNamed:@"cellline.png"]];
    [self addSubview:imageView];
}


@end
